package com.example.com.uiux4.formwidget;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.widget.Toast;

public class MainActivity extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
    }
    
    public void changeLayout(View view) {
    	int id = view.getId();
    	Intent intent;
    	switch(id) {
    	case R.id.edit_text_activity:
    		intent = new Intent(this, EditTextActivity.class);
    		startActivity(intent);
    		break;
    	case R.id.check_box_activity:
    		intent = new Intent(this, CheckBoxActivity.class);
    		startActivity(intent);
    		break;
    	case R.id.radio_box_activity:
    		intent = new Intent(this, RadioBoxActivity.class);
    		startActivity(intent);
    		break;
    	case R.id.toggle_box_activity:
    		intent = new Intent(this, ToggleBoxActivity.class);
    		startActivity(intent);
    		break;
    	case R.id.rating_bar_activity:
    		intent = new Intent(this, RatingBarActivity.class);
        	startActivity(intent);
        	break;
    	case R.id.key_event_activity:
    		intent = new Intent(this, KeyEventActivity.class);
        	startActivity(intent);
        	break;
    	}
    }

	@Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.main, menu);
        return true;
    }
    
}
